﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store/StoreMastePage.Master" AutoEventWireup="true" CodeBehind="GenerateAdjustmentVoucher.aspx.cs" Inherits="logicunivesityinventorystore.GenerateAdjustmentVoucher" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script language="javascript" type="text/javascript">
    function ShowEditModal(ExpanseID) {
        var frame = $get('IframeEdit');
        frame.src = "ItemsPopUp.aspx?UIMODE=EDIT&EID=ss";
        $find('EditModalPopup').show();
    }
    function EditCancelScript() {
        var frame = $get('IframeEdit');
        frame.src = "DemoLoading.aspx";
    }
    function EditOkayScript() {
        RefreshDataGrid();
        EditCancelScript();
    }
    function RefreshDataGrid() {
        $get('<%= Button1.ClientID %>').click();
    }
    function NewExpanseOkay() {
        $get('<%= Button1.ClientID %>').click();
    }
</script>  
    <style type="text/css">
        .style1
        {
            width: 444px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">
        <h1>Generate Adjustment Voucher</h1>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
           
                <ContentTemplate>

             <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Height="1px" 
                        Width="1px" BackColor="White" />
                    <br />   

                    <h3>*Please be reminded to add the necessary items first before changing the quantity.*</h3>
                   
                    
           <table>
            
        <tr>
            <td class="style1"><b><asp:Label ID="lblAdjVoucher" runat="server" 
                    Text="Adjustment Voucher"></asp:Label></b></td>
 
            <td class="style1"><b><asp:Label ID="Label2" runat="server" Text="Date:"></asp:Label><asp:Label ID="lblDate"
                    runat="server" Text="Label"></asp:Label></b></td>
        </tr>
        <tr><td class="style1">&nbsp;</td></tr>
            <tr>
                <td class="style1"><asp:GridView ID="gvNewAdjVoucher" runat="server" 
                        AutoGenerateColumns="False">
            <Columns>
                <asp:TemplateField HeaderText="Item Name">
                    <ItemTemplate>
                        <asp:Label ID="lblItemDesc" runat="server" Text='<%# Eval("ItemCode") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Operator">
                    <ItemTemplate>
                        <asp:DropDownList ID="ddlOperator" runat="server">
                            <asp:ListItem>-</asp:ListItem>
                            <asp:ListItem>+</asp:ListItem>
                        </asp:DropDownList>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Adjustment Qty">
                    <ItemTemplate>
                        <asp:TextBox ID="txtQty" runat="server" ViewStateMode="Enabled" Height="16px" 
                            Width="58px">0</asp:TextBox>
                        <cc1:FilteredTextBoxExtender ID="txtQty_FilteredTextBoxExtender" runat="server" 
                           FilterType="Numbers" Enabled="True" TargetControlID="txtQty">
                        </cc1:FilteredTextBoxExtender>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Reason">
                    <ItemTemplate>
                        <asp:TextBox ID="txt_Reason" runat="server" TextMode="MultiLine" 
                            ViewStateMode="Enabled"></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView></td>
            </tr>
            <tr><td class="style1">&nbsp;</td></tr>
            <tr>
                <td class="style1">
                    <asp:Button ID="btnAdd" runat="server" Text="Add" Height="25px" Width="52px" 
                        onclick="btnAdd_Click" CssClass="ButtonStyle" />
            <cc1:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="modalBackground"
                runat="server" CancelControlID="btnCancel" OkControlID="btnOkay" TargetControlID="btnAdd"
                PopupControlID="Panel1" Drag="true" PopupDragHandleControlID="PopupHeader" OnOkScript="NewExpanseOkay();" BehaviorID="EditModalPopup">
            </cc1:ModalPopupExtender>
            <td class="style1">
                    <asp:Button ID="btnSubmit" runat="server" Height="24px" 
                        onclick="btnSubmit_Click" Text="Submit" Width="62px" 
                        CssClass="ButtonStyle" />
                    <cc1:ConfirmButtonExtender ID="btnSubmit_ConfirmButtonExtender" runat="server" 
                        ConfirmText="Are you Sure you want to generate the Adjustment Voucher?" Enabled="True" TargetControlID="btnSubmit">
                    </cc1:ConfirmButtonExtender>
            </td>
                </td>
             
                <td>&nbsp;</td>
            </tr>
        </table>
                   
           <div class="popup_Buttons" style="display: none">
                
                 <input id="btnOkay" value="Done" type="button" />
                <input id="btnCancel" value="Cancel" type="button" />
            </div>
         <div id="Panel1" style="display: none; width:270px;" class="modalPopup">
                <iframe id="frameeditexpanse" frameborder="0" src="ItemsPopUp.aspx" height="230" scrolling="auto" width="270"; 
                    ></iframe>
            </div>

          
        <br />
        <br />     
        </ContentTemplate>
            <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                </Triggers>
        </asp:UpdatePanel>
        
                      
            </asp:Content>

<asp:Content ID="Content3" runat="server" 
    contentplaceholderid="ContentPlaceHolder3">

                </asp:Content>


<asp:Content ID="Content4" runat="server" 
    contentplaceholderid="ContentPlaceHolder5">
        
                </asp:Content>
<asp:Content ID="Content5" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
          
                </asp:Content>
<asp:Content ID="Content6" runat="server" 
    contentplaceholderid="ContentPlaceHolder7">
       
                </asp:Content>



<asp:Content ID="Content7" runat="server" 
    contentplaceholderid="ContentPlaceHolder4">

                </asp:Content>




